package com.drivers.model;

import lombok.Data;

@Data
public class Result<T> {

    private Integer code;
    private String msg;
    private Object data;

    public static <T> Result<T> success(T object) {
        Result<T> r = new Result<T>();
        r.data = object;
        r.code = 1;
        return r;
    }
    public static  Result error(String msg) {
        Result r = new Result();
        r.msg = msg;
        r.code = 0;
        return r;
    }
}
